//
//  JobCustomCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/13.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#import "JobCustomCell.h"

@implementation JobCustomCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self createUI];
        
        _imgV = [[UIImageView alloc] init];
        [self addSubview:_imgV];
        [_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(30, 30));
            make.left.mas_equalTo(self.mas_left).offset(20);
            make.top.mas_equalTo(self.mas_top).offset(8);
        
        }];
        
        
        _oneLab = [[UILabel alloc] init];
       // _oneLab.text= @"222";
        _oneLab.textColor = [UIColor blackColor];
        _oneLab.font = [UIFont systemFontOfSize:14];
        [self addSubview:_oneLab];
        [_oneLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(120, 20));
            make.left.equalTo(_imgV.mas_right).offset(20);
            make.top.equalTo(self.mas_top).offset(12);
        }];
        _twoLab = [[UILabel alloc] init];
        _twoLab.text= @"99999";
        _twoLab.textColor = OverColor;
        [self addSubview:_twoLab];
//        [_twoLab mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.size.mas_equalTo(CGSizeMake(60, 20));
//            make.left.equalTo(_oneLab.mas_right).offset(20);
//            make.top.equalTo(self.mas_top).offset(12);
//        }];

        _threeLab = [[UILabel alloc] init];
        _threeLab.text = [NSString stringWithFormat:@"%@,%@组",_oneLab,_twoLab];
        [self addSubview:_threeLab];
        
    }
    return self;
}




- (void)createUI{
    //创建一个UIView比self.contentView小一圈
    self.bgView  = [[UIView alloc] initWithFrame:CGRectMake(0,4, SCREEN_WIDTH, 40)];
    self.bgView.backgroundColor = [UIColor whiteColor];
    //给bgView边框设置阴影
    self.bgView.layer.shadowOffset = CGSizeMake(2,2);
    self.bgView.layer.shadowOpacity = 0.3;
    self.bgView.layer.shadowColor = [UIColor blackColor].CGColor;
    [self.contentView addSubview:self.bgView];
}
+ (CGFloat)getHeight{
    //在这里能计算高度，动态调整
    return 100;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
